package com.gxa.order.consumer;

import com.gxa.order.service.OrderManageService;
import entity.MacOrder;
import exception.SystemException;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

//@Component
//@RocketMQMessageListener(consumerGroup = "travel-order",topic = "macOrder-topic")
//@Slf4j
//public class MacOrderConsumer implements RocketMQListener<MacOrder> {
//    @Autowired
//    private OrderManageService orderManageService;
//    @Override
//    public void onMessage(MacOrder macOrder) {
//        if (macOrder.getMacOrderId() == null) {
//            throw new SystemException(1001, "id不能为空！");
//        }
//        //通过
//        orderManageService.updateStatusMacOut(macOrder.getMacOrderId());
//        //修改订单为出票
//        log.info("接收到的消息：{}",macOrder);
//    }
//}
